package main

import (
	"gitee.com/fu-ce-wei/pi-mapper/internal/service"
	"gitee.com/fu-ce-wei/pi-mapper/pkg/logger"
	"go.uber.org/zap"
)

// validateDirectories 验证扫描目录
func validateDirectories(services *Services, appLogger *logger.Logger) {
	// 验证视频扫描目录
	if scanService, ok := services.ScanService.(*service.ScanServiceImpl); ok {
		if err := scanService.ValidateDirectories(); err != nil {
			appLogger.Error("视频扫描目录验证失败", zap.Error(err))
			// 继续启动，但记录错误
		}
	}

	// 验证图片扫描目录
	if imageScanService, ok := services.ImageScanService.(*service.ImageScanServiceImpl); ok {
		if err := imageScanService.ValidateDirectory(); err != nil {
			appLogger.Error("图片扫描目录验证失败", zap.Error(err))
			// 继续启动，但记录错误
		}
	}
}
